Package-level declarations

Functions

Link copied to clipboard
Link copied to clipboard
fun macos_playback_session_append(sessionPtr: COpaquePointer, audioDataSize: Int, audioDataPtr: CArrayPointer<ByteVar>): Int

Append one PCM chunk into the open ingest stream (copies bytes).

Link copied to clipboard

Blocks until the session reaches a terminal state (Finished, Error, or Idle). Returns 0 for Finished, 1 for Error, 2 for Idle (stopped externally).

Link copied to clipboard
fun macos_playback_session_begin_stream(sessionPtr: COpaquePointer, formatDataSize: Int, formatDataPtr: CArrayPointer<ByteVar>, knownByteCount: Long)

Begin a streaming load: macos_playback_session_append feeds PCM chunks; macos_playback_session_end_stream closes ingest. knownByteCount may be -1 for unbounded/live content.

Link copied to clipboard

Writes buffered-range start/end (nanoseconds, end-exclusive) into out pointers.

Link copied to clipboard

Close the ingest stream so the transport can finish after draining.

Link copied to clipboard

Returns the last playback error message bytes (UTF-8), or null if none. Caller must macos_free the pointer. Writes length into sizePtr.

Link copied to clipboard
fun macos_playback_session_load(sessionPtr: COpaquePointer, formatDataSize: Int, formatDataPtr: CArrayPointer<ByteVar>, audioDataSize: Int, audioDataPtr: CArrayPointer<ByteVar>)

Legacy whole-buffer load (still used by older callers). Prefer begin/append/end for long content so the JVM need not retain the full PCM.

Link copied to clipboard

Start playback. State transitions are managed by the JVM caller; use macos_playback_session_await_completion to block until a terminal state.

Link copied to clipboard

Current transport position in nanoseconds.

Link copied to clipboard

Dispose StableRef when you're fully done with the session.

Link copied to clipboard
fun macos_playback_session_seek(sessionPtr: COpaquePointer, positionNanos: Long): Int

Transport seek on the native AudioQueue session.

Link copied to clipboard

Pause an active recording. Capture halts but the AudioQueue + buffers stay allocated so macos_recording_session_resume is cheap and the previously captured chunks remain in the session's hot flow.

Link copied to clipboard

Dispose StableRef when you're fully done with the session (after stop/reset).

Link copied to clipboard

Resume a previously paused recording.

Link copied to clipboard

Start recording and stream updates to the provided callbacks.